FROM docker.io/library/python:3.9.10-alpine

LABEL purpose="Industrial AI API Server"

RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
RUN apk update && apk add sqlite && apk add build-base
RUN mkdir -p /home/www/industrialai
WORKDIR /home/www/industrialai
COPY . /home/www/industrialai

RUN pip install -i https://pypi.tuna.tsinghua.edu.cn/simple -r /home/www/industrialai/requirements.txt
RUN pip install -i https://pypi.tuna.tsinghua.edu.cn/simple gunicorn==20.0.0
RUN pip install /home/www/industrialai

ENTRYPOINT [ "gunicorn_pecan" ]
CMD ["config.py"]
